'''
Created on 2013-11-15

@author: Nich
'''



        
        
        
        
        
        
class RoomFactory():
    
    def __init__(self, component_manager):
        self.component_manager = component_manager
        
    def create_room(self, name, width, length, height, session):
        room = self.component_manager.create_entity({}, session).id
        self.component_manager.add_component_to_object("names", room, data={"name":name}, session=session)
        self.component_manager.add_component_to_object("space", room, data={"width":width, "length":length, "height":height}, session=session)
        self.component_manager.add_component_to_object("object_container", room, session=session)
        self.component_manager.add_component_to_object("location_container", room, session=session)
        self.component_manager.add_component_to_object("type", room, data={"type":"room"}, session=session)
        
        return room
        
        
        
       

        
        

class LocationFactory():
    
    def __init__(self, component_manager):
        self.component_manager = component_manager
        
    def create_location(self, location_data = None):
        loc = self.component_manager.create_entity
        self.component_manager.add_component_to_object("location", loc)
        self.component_manager.add_component_to_object("description", loc)   
        self.component_manager.add_component_to_object("location_content", loc, {"location":loc.id})
        self.component_manager.add_component_to_object("type", loc, data={"type":"location"})
        
        return loc
    
    def link(self):
        pass     
    
    
    